<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
      .active {
        color: red;
      }

      .bgcolor {
        background: skyblue;
      }
      .box {
        font-size: 40px;
      }
    </style>
  </head>

  <body>
    <div id="app">
      <!-- id class style disabled checked 
        自定义属性
          v-bind:属性名="属性值"
          简写    :属性名="属性值"
      -->
      <!--1.   {class:数据} -->
      <div v-bind:class="{'active':ac,'bgcolor':flag}">你好</div>
      <!-- 加载多个对象 -->
      <div v-bind:class="['box',activeClass,errorClass]">9月1</div>
      <!-- 运算符写法 -->
      <div v-bind:class="acflag?'active':''">哈哈</div>
      <!--  -->
      <div class="box" v-bind:class="acflag?activeClass:errorClass">哈哈</div>
      <!-- v-bind:style -->
      <div v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }">
        明天放假
      </div>
      <div v-bind:style="[baseStyle]">9月1</div>
      <div v-bind:style="baseStyle">9月1</div>
      <!-- src  href  -->
      <img :src="mysrc" alt="" />
      <input type="checkbox" :checked="ck" />
      <div :index="item.id">美女</div>
    </div>
    <script src="vue.js"></script>
    <script>
      var vm = new Vue({
        el: '#app',
        data() {
          return {
            item: {
              id: 888
            },
            ck: true,
            mysrc:
              'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1595128334,82706458&fm=26&gp=0.jpg',
            baseStyle: {
              color: 'red',
              background: 'blue'
            },
            activeColor: 'green',
            fontSize: 30,
            ac: true,
            flag: true,
            acflag: false,
            activeClass: 'active',
            errorClass: 'bgcolor'
          }
        }
      })
    </script>
  </body>
</html>
